home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1999 September (IDG) / Sep99.iso / Shareware World / Info / For Developers / Finder Flags Plugin / Finder Flags Sources / Common Files / SetFilePanel.h
Encoding:
C/C++ Source or Header  |  1999-06-19  |  2.9 KB  |  127 lines  |  [TEXT/CWIE]

  1. /*
  2.  *  SetFilePanel.h - 'SetFile Panel' Drop-In Preferences
  3.  *
  4.  *  Copyright © 1995 metrowerks inc.  All rights reserved.
  5.  *
  6.  */
  7.  
  8. #ifndef _H_SetFilePanel
  9. #define _H_SetFilePanel
  10.  
  11. #ifndef __TYPES__
  12. #    include <Types.h>
  13. #endif
  14.  
  15.  
  16. #pragma options align=mac68k
  17.  
  18.  
  19. /* this is the name of the panel, as shown in the Finder */
  20. #define kSetFilePanelName    "Finder Flags Panel"
  21.  
  22.  
  23. /*
  24.  *    AppleScript dictionary info.  As a rule of thumb, dropin panels should use the 
  25.  *    same terminology and numeric code in their 'aete' that the IDE uses if there 
  26.  *    is already a similar item in the IDE's 'aete'.  That is the case here, so we 
  27.  *    merely duplicate applicable 68K Project and 68K Linker user terms below.
  28.  */
  29.  
  30. enum {
  31. /*    Symbolic Name                   Code        AETE Terminology        */
  32.     class_SetFile                = 'SetF',
  33.  
  34.     prefsPR_ProjectType            = 'PR01',    /* Project Type            */
  35.     prefsPR_FileName            = 'PR02',    /* File Name            */
  36.     prefsLN_GenerateSymFile        = 'LN02',    /* Generate SYM File    */
  37.     
  38.     /* enumeration for project type */
  39.     enumeration_ProjectType        = 'PRPT',
  40.     enum_Project_Application    = 'PRPA',    /* application            */
  41.     enum_Project_Library        = 'PRPL',    /* library                */
  42.     enum_Project_SharedLibrary    = 'PRPS',    /* shared library        */
  43.     enum_Project_CodeResource    = 'PRPC',    /* code resource        */
  44.     enum_Project_MPWTool        = 'PRPM'    /* MPW tool                */
  45. };
  46.  
  47.  
  48. /* internal codes for project type */
  49. enum { 
  50.     kProjTypeApplication,
  51.     kProjTypeLibrary,
  52.     kProjTypeSharedLib,
  53.     kProjTypeCodeResource,
  54.     kProjTypeMPWTool
  55. };
  56.  
  57.  
  58. /*    This is the structure that is manipulated by the panel.  The setfile 
  59.  *    compiler & linker both "know" about this structure.
  60.  */
  61.  
  62. typedef struct FlagBits {
  63.     UInt16    alias : 1;
  64.     UInt16    invisible : 1;
  65.     UInt16    bundle : 1;
  66.     UInt16    system : 1;
  67.     UInt16    stationary : 1;
  68.     UInt16    customIcon : 1;
  69.     UInt16    rsvd0x0200 : 1;
  70.     UInt16    inited : 1;
  71.     UInt16    noinits : 1;
  72.     UInt16    shared : 1;
  73.     UInt16    rsvd0x003e : 5; 
  74.     UInt16    onDesk : 1;
  75. } FlagBits;
  76. #define    validAttrBits    (kIsOnDesk | kIsShared | kHasNoINITs | kHasBeenInited | kHasCustomIcon | kIsStationery | kNameLocked | kHasBundle | kIsInvisible | kIsAlias)
  77.  
  78. typedef struct XFlagBits {
  79.     UInt16    rsvd0xFE00 : 7;
  80.     UInt16    badge : 1;
  81.     UInt16    rsvd0x00F8 : 5;
  82.     UInt16    routing : 1;
  83.     UInt16    rsvd0x0003 : 2;
  84. } XFlagBits;
  85. #define    validAttrXBits    (kExtendedFlagHasCustomBadge | kExtendedFlagHasRoutingInfo)
  86.  
  87. typedef struct SetFilePref {
  88.     short    version;
  89.     UInt16    align1;                
  90.     UInt32    creator;            /* version # of prefs data    */
  91.     UInt32    type;                /* project type                */
  92.     Boolean    lock;
  93.     Boolean    alwaysSwitch;
  94.     UInt16    align2;
  95.     union {
  96.         FlagBits    bits;
  97.         UInt16        flags;
  98.     };
  99.     union {
  100.         XFlagBits    xbits;
  101.         UInt16        xflags;
  102.     };
  103. } SetFilePref, **SetFilePrefHandle;
  104.  
  105.  
  106. enum {
  107.     kCreatorItem = 2,
  108.     kTypeItem = 4,
  109.     kAliasItem,
  110.     kInvisibleItem,
  111.     kBundleItem,
  112.     kSystemItem,
  113.     kStationaryItem,
  114.     kCustomIconItem,
  115.     kLockedItem,
  116.     kInitedItem,
  117.     kNoInitsItem,
  118.     kSharedItem,
  119.     kRoutingItem,
  120.     kDeskTopItem,
  121.     kBadgeItem
  122. };
  123. #pragma options align=reset
  124.  
  125.  
  126. #endif    /* _H_SetFilePanel */
  127.